package com.wy.sloth.model;

import java.io.Serializable;

import com.wy.sloth.constant.SlothOrder;

import lombok.Getter;
import lombok.Setter;

/**
 * 分页参数
 * 
 * @author wangyuan
 * @since 2019年3月7日
 */
@Getter
@Setter
public class SlothPage implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 3747616371967067459L;

    /**
     * 每页显示条数，默认 10
     */
    private int size = 10;

    /**
     * 当前页
     */
    private int current = 1;
    
    /**
     * 排序列
     * "updatedTime"，"dealStatus"
     */
    private String orderByField = "updatedTime";
    
    private SlothOrder order = SlothOrder.DESC;
    
    public long getOffset(){
        return Integer.toUnsignedLong((current - 1) * size);
    }
    
    public long getCount(){
        return Integer.toUnsignedLong(size);
    }

}
